#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int N=2e5+10;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
//----------------------------------------------------------------------------//
int n;
void solve()
{
	cin>>n;
	string s;
	cin>>s;

	s=" "+s;

	//int pos=0;
	int i=1;
	for(;i<=n;i++)
	{
		//pos=i;
		if(s[i]=='0') break;
	}

	if(i==n+1) cout<<1<<" "<<n-1<<" "<<2<<" "<<n<<'\n';//长度要相同,这是1:1的关系
	else if(i<=n/2) cout<<i<<" "<<n<<" "<<i+1<<" "<<n<<'\n';//pos到右边较大
	else cout<<1<<" "<<i<<" "<<1<<" "<<i-1<<'\n';//pos到左边较大


	
}

int main()
{
	close();
	int T; cin>>T;
	while (T--) solve();
	return 0;
}

//从前往后遍历,没遇到0都是1,遇到0的位置相当于*2的关系

//左端的0没有用